package com.smc.demo.activity.utils;

import android.app.Instrumentation;
import android.view.KeyEvent;
import android.view.MotionEvent;

/**
 * Created by zhujm on 2020/9/6.
 */

public class InstrumentationUtil{

    public static void sendKeySync(KeyEvent keyEvent){
        Instrumentation ins = ActivityThreadUtil.getInstance().getInstrumentation();
        ins.sendKeySync(keyEvent);
    }

    public static void sendPointerSync(MotionEvent event){
        Instrumentation ins = ActivityThreadUtil.getInstance().getInstrumentation();
        ins.sendPointerSync(event);
    }

    public static void sendTrackballEventSync(MotionEvent event){
        Instrumentation ins = ActivityThreadUtil.getInstance().getInstrumentation();
        ins.sendTrackballEventSync(event);
    }

}
